package com.iv.durian.cloud.service;

import com.iv.durian.cloud.Notice;
import com.iv.durian.cloud.dao.NoticeDao;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeService {

    @Autowired
    private NoticeDao noticeDao;

    public Notice get(Integer id) {
        return noticeDao.get(id, null);
    }

    public Notice get(int lessionId) {
        return noticeDao.get(null, lessionId);
    }

    public int add(Notice notice) {
        return noticeDao.add(notice);
    }

    public int update(Notice notice) {
        return noticeDao.update(notice);
    }

    public int remove(int id) {
        return noticeDao.remove(id);
    }

    public int count(Notice notice) {
        return noticeDao.count(notice);
    }

    public List<Notice> list(Integer lessionId, Integer offset, Integer limit) {
        return noticeDao.list(lessionId, offset, limit);
    }


}
